package com.wulian.service.impl;

import com.wulian.dao.DoctorDao;
import com.wulian.entities.Doctor;
import com.wulian.entities.Patient;
import com.wulian.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DoctorServiceImpl implements DoctorService {

    @Autowired
    private DoctorDao doctorDao ;

    @Override
    public List<Doctor> selAllDoctor() {
        return doctorDao.selAllDoctor();
    }

    @Override
    public Doctor selDocById(Long doctor_id) {
        return doctorDao.selDocById(doctor_id);
    }

    @Override
    public Integer loginDoctor(Doctor doctor) {
        return doctorDao.loginDoctor(doctor);
    }

    @Override
    public void updateDoctor(Doctor doctor) {
        doctorDao.updateDoctor(doctor);
    }

    @Override
    public void addDoctor(Doctor doctor) {
        doctorDao.addDoctor(doctor);
    }

    @Override
    public List<Patient> getPatientByDocName(String name) {
        return doctorDao.getPatientByDocName(name);
    }

    @Override
    public List<Doctor> getAllByPage(Integer num, Integer size) {
        return doctorDao.getAllByPage(num, size);
    }
}
